import React, { Component } from 'react'
import {Switch, Route} from 'react-router-dom'
// 在父组件中到如子组件
import Page1 from './Page1'
import Page2 from './Page2'
import Page3 from './Page3'

export default class BigPage extends Component {
  render() {
    return (
      <div>
        <p className="top">top</p>
        <p className="left">left</p>
        {/* 嵌套路由放在父组件中 */}
        <Switch>
          {/* path要写成完整的路径 */}
          <Route exact path="/bigpage/" component={Page1}></Route>
          <Route path="/bigpage/page2" component={Page2}></Route>
          <Route path="/bigpage/page3" component={Page3}></Route>
        </Switch>
      </div>
    )
  }
}
